package com.itheima.thread.communication.demo03;

public class BoxDemo {

    public static void main(String[] args) {

        // 创建一个奶箱对象
        Box box = new Box() ;

        // 创建生产者线程的任务类对象
        ProducerThread producerThread = new ProducerThread(box) ;

        // 创建消费者线程的任务类对象
        CustomerThread customerThread = new CustomerThread(box) ;

        // 创建Thread对象
        Thread t1 = new Thread(producerThread) ;        // 生成者线程对象
        Thread t2 = new Thread(customerThread) ;        // 消费者线程对象

        // 启动线程
        t1.start();
        t2.start();

    }

}
